package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;

import java.util.List;

public interface ShoppingCartMapper {
    /**
     * 根据条件查询购物车数据
     * @param shoppingCart
     * @return
     */
    List<ShoppingCart> getBy(ShoppingCart shoppingCart);

    /**
     * 更新购物车数量
     * @param cartDB
     */
    void update(ShoppingCart cartDB);

    /**
     * 插入数据
     * @param shoppingCart
     */
    void insert(ShoppingCart shoppingCart);

    /**
     * 根据用户id删除购物车数据
     * @param currentId
     */
    void deleteByUserId(Long currentId);

    /**
     * 根据id删除购物车数据
     * @param id
     */
    @Delete("delete from shopping_cart where id = #{id}")
    void deleteById(Long id);


}
